function Card( name, content_url, loadscript_url ) {
    this.name = name;
    this.content_url = content_url;
    this.loadscript_url = loadscript_url;
    if( null != loadscript_url ) {
	Log.logWithFacility("CARD","Creating New Card (" + name + "," + content_url + "," + loadscript_url + ")" );
    } else {
	Log.logWithFacility("CARD","Creating New Card (" + name + "," + content_url + ")" );
    }
    this.load();
}

Card.prototype.getName = function () {
    return( this.name );
};

Card.prototype.getContent = function () {
    return( this.content );
};

Card.loadFromURL = function ( url ) {
    var req = new XMLHttpRequest();
    var response = "";

    try {
	req.open("GET", url, false );
	req.send("");
	response = req.responseText;
    } catch ( e ) {
	Log.logWithFacility("CARD","Error Loading Card (" + e.message + ")" );
    }
    return( response ); 
};

Card.prototype.load = function () {
    
    Log.logWithFacility("CARD","Loading Card (" + this.name + ") contents from (" + this.content_url + ")" );

    this.contents = Card.loadFromURL( this.content_url );

    if( null != this.loadscript_url ) {
	Log.logWithFacility("CARD","Loading Card (" + this.name + ") loadscript from (" + this.loadscript_url + ")" );
	this.loadscript = Card.loadFromURL( this.loadscript_url );
    }	
};

Card.prototype.draw = function () {
    document.getElementById("cardname").innerHTML = this.name;
    document.getElementById("right").innerHTML = this.contents;
};